//商品详情页面
<template>
  <div>
    <el-dialog
      :visible.sync="dialogVisible"
      :before-close="handleClose"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
    <span slot="title"> 商品详情页面</span>
      <div>

      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handleClose">关闭</el-button>
      </span>
    </el-dialog>    
  </div>
</template>

<script>
export default {
    name: "Productdetail",
    props: {
        showProductDetail:{
            type: Boolean,
            default: false
        }
    },
    watch: {
        showProductDetail: {
            handler(newVal) {
                 this.dialogVisible=newVal   
            },
            immediate: true,
            deep: true
        }
    },
    data() {
        return {
            dialogVisible: this.showProductDetail,
        }
    },
    methods: {
        handleClose() {
            this.dialogVisible = false;
            this.$emit("close" ,false);
        }
    }
}
</script>

<style>

</style>